{include file="common/header.tpl"}
<section class="main">
    <article class="right-col">
    	<h2><a href="{$back}">Danh mục sản phẩm</a> &raquo; Cập nhật</h2>
        <form name="frmEdit" id="frmEdit" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}category/saveedit" class="ui">
            <input type="hidden" name="pcategoryid" id="pcategoryid" value="{$row.categoryid}" />
            <input type="hidden" name="pstoreid" id="pstoreid" value="{$row.storeid}" />
            <input type="hidden" name="pparentid" id="pparentid" value="{$row.parentid}" />
            <input type="hidden" name="ptype" id="ptype" value="{$row.type}" />
            <ul>
                {if isset($smarty.session.CATEGORY_ERROR)}
                    <li class="error">
                        {include file="common/error.tpl" errors=$smarty.session.CATEGORY_ERROR}                        
                    </li>
                {/if} 
                {if $row.parentid}
                    <li>
                        <label>Danh mục cha:</label>
                        <strong class="hint">{$row.parent_name}</strong>
                    </li>
                {/if}            
                <li>
                    <label for="pname">Tên <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.CATEGORY_POST.pname)}{$smarty.session.CATEGORY_POST.pname|escape}{else}{$row.name|escape}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}" />
                    </div>
                </li>
                <li>
                    <label for="pslug">Slug:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pslug" id="pslug" value="{if isset($smarty.session.CATEGORY_POST.pslug)}{$smarty.session.CATEGORY_POST.pslug|escape}{else}{$row.slug|escape}{/if}" maxlength="255" />
                    </div>
                </li>
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.CATEGORY_POST.ptag)}{$smarty.session.CATEGORY_POST.ptag|escape}{else}{$row.tag|escape}{/if}" maxlength="100" />
                    </div>
                </li>
                <li>
                    <label for="pshort">Tóm lược:</label>
                    <div class="area">
	                    <textarea rows="1" cols="1" id="pshort" name="pshort">{if isset($smarty.session.CATEGORY_POST.pshort)}{$smarty.session.CATEGORY_POST.pshort|escape}{else}{$row.short|escape}{/if}</textarea>
                    </div>
                </li>
                <li>
                    <label for="pimage">Icon:</label>
                    <div class="txt">
                    	<input type="file" class="text" name="pimage" id="pimage" value="" />
                    </div>
                </li>
               
                <li>
                    <label for="pimage2">Icon active/hover:</label>
                    <div class="txt">
                    	<input type="file" class="text" name="pimage2" id="pimage2" value="" />
                   	</div>
                </li> 
                
                <li>
                    <label for="piseq">Thứ tự Hiển thị:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="piseq" id="piseq" value="{if isset($smarty.session.CATEGORY_POST.piseq)}{$smarty.session.CATEGORY_POST.piseq}{else}{$row.iseq}{/if}" onkeypress="javascript: return isNumberKey(event);"/>
                    </div>
                </li>     
                <li>
                	<button type="submit"><strong>Lưu dữ liệu</strong></button>
                    <button type="button" onclick="document.location.href='{$back}'" class="cancel"><strong>Hủy</strong></button>
                </li>
        	</ul>
        </form>
	</article>
</section>  
{include file="common/footer.tpl"}